﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Tour.BLL;
using Tour.DAL;
using System.Text;

public partial class Tourist_Contact : VST.Controls.BaseLCGPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    TblContactEntity GetTblContact()
    {
        TblContactEntity item = new TblContactEntity();
        //item.Id =1;
        item.Name = txtName.Text;
        item.Email = txtEmail.Text;
        item.Address = txtAddress.Text;
        item.Phone = txtAddress.Text;
        item.LanguageId = WorkingLanguage;
        item.DisplayOrder = 1;
        item.Content = txtContent.Text;
        item.CreatedBy = HttpContext.Current.User.Identity.Name;
        item.CreatedDay = DateTime.Now;
        item.UpdatedBy = HttpContext.Current.User.Identity.Name;
        item.UpdatedDay = DateTime.Now;
        return item;
    }
    protected void btnSend_Click(object sender, EventArgs e)
    {
        TblContactManager.CreateInstant().InsertUpdate(GetTblContact());
        string messagebox = "Quý Khách đã liên hệ thành công";
        StringBuilder stringbuilder = new StringBuilder();
        stringbuilder.Append("<script language='javascript'>");
        stringbuilder.Append("alert(\"" + messagebox + "\");");
        stringbuilder.Append("<" + "/script>");
        Response.Write(stringbuilder.ToString());
        txtName.Text = "";
        txtEmail.Text = "";
        txtAddress.Text = "";
        txtContent.Text = "";
    }
}